class HomeController < ApplicationController

  def home
	if (self.current_user.respond_to?("is_not_student?")) && (not self.current_user.is_not_student?)
		@runner = self.current_user.get_runner
		add_page_token(@runner.name + "'s Map")
		@is_student = true
		# next two probably should be combined to one db call
		@incentive = Incentive.first(:order => "goal", :conditions => {:goal => @runner.distance_cache..101});
		@previnc = Incentive.find(:all, :order => "goal", :conditions => {:goal => 0..@runner.distance_cache});
		@landmarks = Landmarks.find(:all)
		@index = @runner.index_route
		render :action => "studenthome" and return
	end
    	@sites = Site.find(:all)
    	add_page_token(@program.name)
  end

end
